<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Insert title here</title>
<%@ include file="../include/top.jsp" %>
<%@ include file="../include/errorArea.jsp" %>
<%@ include file="../include/bottom.jsp" %>
</head>
<script>
	function fileSubmit(){
		 var uploadFile = $("#uploadFile").val();
		 if(uploadFile == "" || uploadFile == null){
			 alert("请选择上传图片");
			 return false;
		 }
		 //var a = document.getElementById("picTable").rows.cells.length;
		 var a = $("#picTable th").length;
		 if(a > 4){
			 alert("只能上传5张图片");
			 return false;
		 }
		 $("#fileSubmitAction").submit();
	}
</script>
<body>
<form action="${ctx}/wjsc/create" method="post" name="fileSubmitAction" id="fileSubmitAction" enctype="multipart/form-data">
<input type="hidden" value="${ywid}" name="ywid">
<input type="hidden" value="${fromPage}" name="fromPage">
<c:if test="${fromPage=='update'}">
<div class="padding5">
	<table class="tableStyle">
		<tr>
			<td>图片上传：</td>
			<td><input type="file" name="uploadFile" id="uploadFile" class="required" size="30"/></td>
			<td><input type="button" value="上传" onclick="fileSubmit();"></td>
		</tr>
	</table>
</div>
</c:if>
<!-- 顶部功能区 end -->

<!-- 列表区头部 start -->
<div class="padding5">
	<table id="picTable" class="tableStyle" sortMode="true" headFixMode="true" useMultColor="true" useCheckBox="true">
		<!-- <tr>
			<th>文件名称</th>
			<th width="100">操作</th>
		</tr> -->
		<tbody>
			<c:forEach items="${obj}" var="wjsc" varStatus="status">
				<th>
				 <img src="http://115.29.79.66/${wjsc.wjUrl}" style="height:120px"/></br> 
				<%--<img src="http://127.0.0.1:8080/${wjsc.wjUrl}" style="height:120px"/></br>--%>
				<c:if test="${fromPage=='update'}">
					<a href="${ctx}/wjsc/delete/${wjsc.wjId}/${ywid}/${fromPage}" class="btnDel"><span style="color:#2678b2">删除</span></a>
				</c:if>
				</th>
				<%-- <tr target="wjsc_id" rel="${wjsc.wjId }">
					<td><img src="${ctx}${wjsc.wjUrl}" style="height:40px"/></td>
				</tr> --%>
			</c:forEach>
		</tbody>
	</table>
</div>
<%-- <img src="${ctx}/abc/10.png"  style="height:40px"/> --%>
</body>
</html>